#include <iostream>

int *func()
{
    int *p = new int(10);
    return p;
}

int main(int argc, char const *argv[])
{
    int *a = func();
    std::cout << *a << std::endl;
    std::cout << a << std::endl;
    std::cout << &a << std::endl;

    delete a;
    std::cout << *a << std::endl;

    return 0;
}
